/**
 * 所有版权归 广西梧州 陈锦韬 所有
 *
 * @Title: PlfUserInfoForm
 * @Package com.rx.vo
 * @Description: 用户信息表单
 * @author: 陈锦韬
 * @date: 2020\9\8 0008
 * @version V1.0
 * @Copyright: 2020 陈锦韬  All rights reserved.
 */
package com.rx.stock.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.rx.core.base.RxBaseConstant;
import com.rx.core.data.RxData;
import com.rx.core.dbase.RxMarkDbMust;
import com.rx.core.enm.RX_STATUS;
import com.rx.core.util.RxUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author: Administrator
 * @Description: 地区代码表单
 * @date: 2020\9\8 0008
 */
@RxData
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class StockMaxInfo extends RxMarkDbMust{
    private static final long serialVersionUID = 1L;


    /**
     * 状态0-正常 1-废弃
     */
    @TableField("STATUS")
    private String status;

    /**
     * 代码
     */
    @TableField("SHARE_CODE")
    private String shareCode;

    /**
     * 备注
     */
    @TableField("MAX_FLG")
    private String maxFlg;


    @TableField("AMOUNT")
    private BigDecimal amount;

    @TableField("TRADE_TIME")
    @JSONField(format = RxBaseConstant.DATE_FORMAT_DATETIME)
    private Date tradeTime;


    @TableField("DIFF_AMOUNT")
    private BigDecimal diffAmount;

    @TableField("DIFF_RATE")
    private BigDecimal diffRate;

    @TableField("TYPE")
    private String type;

    public static StockMaxInfo createByLocation(MaxLocationInfo maxLocationInfo,String shareCode){
        StockMaxInfo stockMaxInfo = new StockMaxInfo();
        RxUtil.copyProperties(maxLocationInfo,stockMaxInfo);
        stockMaxInfo.setShareCode(shareCode);
        stockMaxInfo.setStatus(RX_STATUS.NORMAL.getCode());
        return stockMaxInfo;
    }

}
